package pe.gob.onpe.util;

import javax.persistence.NoResultException;
import javax.persistence.Query;

public class Persistencia {
	
	
	@SuppressWarnings("unchecked")
	public static final <T>T getSingleResult(Query query, Class<T> clazz){
		try{
			return (T)query.getSingleResult();
		}catch (NoResultException e) {
			e.printStackTrace();
			return null;
		}
	}

}
